global maximo

%define ptr_v [ebp + 8]
%define n [ebp + 12]

section .text

maximo:
	push ebp
	mov ebp, esp
	push esi
	push edi
	push ebx

	mov esi, ptr_v
	mov ecx, n
	cmp ecx, 0
	je fin
	
	dec ecx
	mov eax, [esi + ecx * 4]
	cmp ecx, 0
	je fin
	
ciclo:
	dec ecx
	mov ebx, [esi + ecx * 4]
	cmp ebx, eax
	jle esMenor
	mov eax, ebx
esMenor:
	cmp ecx, 0
	jne ciclo
	
fin:
	pop ebx
	pop edi
	pop esi
	pop ebp
	ret
